#include <dao.h>
#include <btBulletDynamicsCommon.h>

#include "btDispatcher.h"
#include "btCollisionDispatcher.h"

static void construct(DaoContext *ctx, DValue *p[], int N) {
    btCollisionConfiguration* collisionConfiguration = (btCollisionConfiguration*) DaoCData_GetData(p[0]->v.cdata);

    btDispatcher* ptr = new btCollisionDispatcher(collisionConfiguration);

    DaoCData *cdata = DaoContext_PutCData(ctx, ptr, &btCollisionDispatcherTyper);
};

static void destruct(void *self) {
//    delete (btCollisionDispatcher*) self;
}

static DaoFuncItem meth[] = {
    { construct, "btCollisionDispatcher(collisionConfiguration:btCollisionConfiguration)" },
    { NULL, NULL }
};

DaoTypeBase btCollisionDispatcherTyper = {
    "btCollisionDispatcher",
    NULL,
    NULL,               		/* constant */
    meth,       			/* methods */
    { &btDispatcherTyper, NULL },     	/* parent type */
    { NULL },
    destruct,
    NULL
};
